//
// Created by chaseaishang on 23-4-16.
//

#pragma once
#include "Render/StdAfx.h"
#include<utility>
#include "keyCodes.h"
struct Mouse
{
public:
    enum State
    {
        CSAS_PRESSED=0,
        CSAS_RELEASED=1
    };
    bool l_Button_Released=CSAS_RELEASED;
    bool r_Button_Released=CSAS_RELEASED;
    float x_pos;
    float y_pos;
    float x_offSet;
    float y_offSet;
public:
    void Set_MousePos(float x_pos,float y_pos)
    {
        this->x_pos=x_pos;
        this->y_pos=y_pos;
    }
    void Get_MousePos(float&x_pos,float&y_pos)
    {
        x_pos=this->x_pos;
        y_pos=this->y_pos;
    }
    bool Is_LButonRelease()
    {
        return l_Button_Released==CSAS_RELEASED;
    }
    bool Is_RButonRelease()
    {
        return r_Button_Released==CSAS_RELEASED;
    }
    bool Is_LButonPress()
    {
        return l_Button_Released==CSAS_PRESSED;
    }
    bool Is_RButonPress()
    {
        return r_Button_Released==CSAS_PRESSED;
    }
    //true release   false press
    void SetLButtonState(bool state)
    {
        l_Button_Released=state;
    }
    //true release   false press
    void SetRButtonState(bool state)
    {
        r_Button_Released=state;
    }
};
class Input
{
public:
    static bool IsKeyPressedImpl(int keycode);
    static bool IsMouseButtonPressedImpl(int MouseCode);
    static std::pair<float, float>GetMousePositionImpl();
};



